#pragma once

#include "config.h"
#include "debugtool.h"
#include "exception.h"

string SafeGetHostName(const string hostName);

void SleepMS(unsigned long msec);

void SleepS(unsigned long sec);

uint64 GetCurTime();

char* StringNew(const char* string, const int lenString = 0);

char* GetSubstring(const char* src, int pos, char label);

void SplitString(const string& s, const string& delim, vector<string>& ret);

int ParseInt(const string& str);
float ParseFloat(const string& str);
string ToString(int num);

#define NUM_INRANGE(low, Num, High) (((low) <= (Num)) && ((Num) <= (High)))